<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/11/24
  Time: 16:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>"/>
    <title>服务创建</title>
    <link rel="stylesheet" href="../static/commons/layui/css/layui.css" />
    <link rel="stylesheet" href="../static/commons/layui/css/layui.mobile.css" />
</head>
<body class="childrenBody">
<blockquote class="layui-elem-quote">
<form class="layui-form" action="service-management/insertService" method="post">
    <h2>服务创建</h2><br/>
    <div class="layui-form-item">
        <label class="layui-form-label layui-bg-green layui-center">服务状态</label>
        <div class="layui-input-block">
            <select name="status" lay-verify="required">
                <option value="">请选择服务状态</option>
                <option value="新创建">新创建</option>
            </select>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label layui-bg-green layui-center">客户名称</label>
        <div class="layui-input-block">
            <select name="customerName" lay-verify="required" lay-search id="customerNameSelect">
                <option value="">请选择</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-bg-green layui-center">服务类型</label>
        <div class="layui-input-block">
            <select name="serviceType" lay-verify="required">
                <option value="">请选择服务类型</option>
                <option value="询问">询问</option>
                <option value="建议">建议</option>
                <option value="投诉">投诉</option>
                <option value="预约">预约</option>
                <option value="合作">合作</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label layui-bg-green layui-center">概要</label>
        <div class="layui-input-block">
            <input type="text" placeholder="请输入内容"  name="outline" class="layui-input" autocomplete="off" />
        </div>
    </div>

    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label layui-bg-green layui-center">服务请求</label>
        <div class="layui-input-block">
            <textarea name="serviceReq" lay-verify="required" placeholder="请输入内容" class="layui-textarea" autocomplete="off"></textarea>
        </div>
    </div>

    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label layui-bg-green layui-center">创建人</label>
        <div class="layui-input-block">
            <input type="text" name="creationName" required lay-verify="required" value="${userInfo.name}" readonly class="layui-input">
            <%--<input type="text" name="creationName" required lay-verify="required" autocomplete="off" placeholder="请输入姓名"  class="layui-input">--%>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">保存</button>
            <button type="reset" class="layui-btn layui-btn-danger">重置</button>
        </div>
    </div>
</form>
</blockquote>

<p layui-center>${msg}</p>
<script type="text/javascript" src="../static/commons/layui/layui.js" ></script>
<script type="text/javascript" src="../static/js/serviceManagement/service-creation.js" ></script>
<script type="text/javascript">
    layui.use(['jquery','form'],function(){
        let $ = layui.jquery,
            form = layui.form;
        $.get("service-management/findCustomerName",function(dataC){
            dataC.data.customers.forEach(function(role){
                $("#customerNameSelect").append("<option value='"+role.customerName+"'>"+role.customerName+"</option>");
            });
            form.render('select');
        });
    });
</script>
</body>
</html>
